import { createApp } from "vue";
import App from "./App.vue";

import "virtual:svg-icons-register";

// 引入状态管理
import { setupStore } from "@/store";

// 引入全局样式
import "@/assets/styles/common.scss";

// 引入动画
import "animate.css";

// 路由
import router, { setupRouter } from "@/router";

import Logger from "@/utils/Logger";
import { setupElementPlus } from "./plugins/element-plus";
import { setupDTJsBridge } from "./plugins/dt-jsbridge";

// 创建实例
const setupAll = async () => {
  const app = createApp(App);

  setupElementPlus(app);
  setupStore(app);

  setupRouter(app);
  setupDTJsBridge(app);
  app.config.globalProperties.VITE_BASE_PATH = import.meta.env.VITE_BASE_PATH;

  await router.isReady();
  app.mount("#app");
};
setupAll();

Logger.prettyPrimary(`欢迎使用`, import.meta.env.VITE_APP_TITLE);
